<%--
  Created by IntelliJ IDEA.
  User: szq
  Date: 2022/3/24
  Time: 14:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>



<div style="text-align: center;border-radius: 15px;background-color: #dbd6d6 ;width: 96%;margin-left: 2%;margin-top: 1%;min-width: 96%;min-height: 200px;max-width: 96%;padding: 20px;">
    <span style="font-size: 30px;color: black">本站全部IP地址获取地理位置数据来自 <a style="color: #00a0e9" href="https://www.ip138.com/" target="_blank">https://www.ip138.com/</a> </span>
    <br><span style="font-size: 30px;color: black">由于每日每个IP免费查询次数有限，所以以下页面可能失效，请自行前往相关网站！</span>
    <iframe name="ip_frame" src="//2022.ip138.com/" rel="nofollow"  width="100%" height="70" frameborder="0" scrolling="no" style="font-size: 30px;"></iframe>

</div>
<div style="border-radius: 15px;background-color: #ffffff ;width: 96%;margin-left: 2%;margin-top: 1%;min-width: 96%;min-height: 600px;max-width: 96%;padding: 20px;">

    <div class="data_list" style="width: 48%;height: 90%;min-height: 520px;max-height: 90%;border-radius: 15px;background-color: #deddd9;float: left">
        <h4 style="margin-left: 5%">群发邮件或者系统通知</h4>
        <input id="time" type="datetime-local" class="form-control" placeholder="2022-04-17 14:21:12" style="width: 150px;margin-left: 5%;">
        <span style="margin-left: 5%">时间必须比现在晚五分钟以上，留空则为立刻发送（请注意按钮的选择）</span>
        <br>
        <button class="btn btn-primary" style="margin-left: 5%" onclick="sendEmail(1)">发送邮件</button>
        &nbsp;&nbsp;
        <button class="btn btn-success" style="margin-left: 5%" onclick="sendEmail(2)">发送通知</button>
        <br><br>
        <textarea id="emailText" placeholder="此处输入邮件内容或者通知内容" class="form-control" style="width: 90%;height: 350px;margin-left: 5%;min-height: 80%;resize: none"></textarea>
    </div>

    <div class="data_list" style="margin-left: 4%;width: 48%;height: 90%;min-height:250px;border-radius: 15px;background-color: #A8A297;float: left;overflow: hidden">
        <iframe src="https://cn.bing.com/" style="width: 655px;height: 220px"></iframe>
    </div>

    <div class="data_list" style="margin-left: 4%;width: 48%;height: 90%;min-height:250px;border-radius: 15px;background-color: #5e5951;float: left">
        <audio class="" autoplay="autoplay" controls="controls" loop="loop" src="statics/music/yy_low.mp3"></audio>
    </div>

</div>

<div style="border-radius: 15px;background-color: #ffffff ;width: 96%;margin-left: 2%;margin-top: 1%;min-width: 96%;min-height: 470px;max-width: 96%;padding: 20px;">
    <div class="data_list" style="margin-bottom: 20px;float: left;border-radius: 15px;width: 48%;height: 400px;min-height: 400px;background-color: #00a0e9">
<%--
        <iframe style="width: 100%;height: 100%;border-radius: 10px;" src="//player.bilibili.com/player.html?aid=595397928&bvid=BV15q4y1a7sJ&cid=569767126&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" > </iframe>
--%>
        <iframe style="width: 100%;height: 100%;border-radius: 10px;" src="//player.bilibili.com/player.html?aid=19390801&bvid=BV1bW411n7fY&cid=31621681&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>
    </div>

    <div class="data_list" style="border-radius: 15px;float: left;width: 48%;margin-left: 4%;background-color: #2b542c;height: 190px;min-height: 192px;">

    </div>

    <div class="data_list" style="border-radius: 15px;float: left;width: 23%;margin-left: 4%;background-color: #8a6d3b;height: 190px;min-height: 192px;">
        <FORM METHOD="get" ACTION="https://www.ip138.com/iplookup.asp" name="ipform" target="_blank">
            <tr><td align="center">IP地址：<input type="text" name="ip" size="16">
                <input type="submit" value="查询"><INPUT TYPE="hidden" name="action" value="2">
            </td></tr></FORM>
    </div>

    <div class="data_list" style="border-radius: 15px;float: left;width: 23%;margin-left: 2%;background-color: #e7ad48;height: 190px;min-height: 192px;">

    </div>
</div>

<div style="border-radius: 15px;background-color: #ffffff ;width: 96%;margin-left: 2%;margin-top: 1%;min-width: 96%;min-height: 370px;max-width: 96%;padding: 20px;">

    <div class="data_list" style="float: left;border-radius: 15px;width: 31%;min-height: 300px;background-color: #b9b9c4">

    </div>

    <div class="data_list" style="float: left;border-radius: 15px;width: 30%;margin-left: 4%;min-height: 300px;background-color: #00cc1b">

    </div>

    <div class="data_list" style="float: left;border-radius: 15px;width: 31%;margin-left: 4%;min-height: 300px;background-color: #cc5f00">

    </div>
</div>

<div style="border-radius: 15px;background-color: #ffffff ;width: 96%;margin-left: 2%;margin-top: 1%;min-width: 96%;min-height: 770px;max-width: 96%;padding: 20px;">

    <div class="data_list" style="float: left;border-radius: 15px;width: auto;min-height: 700px;background-color: #b9b9c4">
        <iframe style="width: 500px;height: 680px;border-radius: 20px;" src="http://tool.mkblog.cn/robot/" ></iframe>
    </div>


</div>

<script type="text/javascript">

    function selectType() {
        var s = document.getElementsByName("rem");
        var b = s.checked;
        var flag = 0;
        if (s.checked){
            alert("t");
            flag = 1;
            //document.getElementById("time").disabled = false;
        }else{
            alert("f");
            flag = 0;
            //document.getElementById("time").disabled = true;
        }
        alert(flag);
    }


    function getTime() {
        var t = document.getElementById("time").value;
        alert(t);
    }

    function sendEmail(s) {

        var t = document.getElementById("time").value;
        var text = document.getElementById("emailText").value;

        if (text == null || text.length < 3 || text.length > 128){
            swal({
                title:"温馨提示",
                text:"内容长度3-128个字符！",
                type: "warning", // 图标  error	 success	info  warning
                showCancelButton: false,  // 是否显示取消按钮
                confirmButtonColor: "green", // 确认按钮的颜色
                confirmButtonText: "确定", // 确认按钮的文本
                allowOutsideClick: false, //不允许点击其他地方（点击其他地方不关闭）
            });
            return;
        }

        var str = '';
        var action = '';
        if (s == 1){
            action = "sendEmail";
        }else{
            action = "sendNotify";
        }

        $.ajax({
            type:"post",
            url:"admin",
            data:{
                actionName:action,
                text:text,
                time:t
            },
            success:function (code) {

                if (code == 1 || code == "1"){
                    str = '群发邮件或者通知成功，请注意是否正常';
                }else if (code == 2 || code == "2"){
                    str = '群发邮件或者通知部分失败，请检查服务端';
                }else if (code == -1 || code == "-1"){
                    str = '定时群发邮件或者通知成功，请注意是否正常';
                }else if (code == -3 || code == "-3"){
                    str = '定时太短，请至少定时5分钟以后！';
                }else if (code == -4 || code == "-4"){
                    str = '内容长度3-128个字符！';
                }else {
                    str = '群发邮件或者通知失败，请检查服务端';
                }

                swal({
                    title:"温馨提示",
                    text:str,
                    type: "info", // 图标  error	 success	info  warning
                    showCancelButton: false,  // 是否显示取消按钮
                    confirmButtonColor: "green", // 确认按钮的颜色
                    confirmButtonText: "确定", // 确认按钮的文本
                    allowOutsideClick: false, //不允许点击其他地方（点击其他地方不关闭）
                })
            }
        });

    }

</script>